Relational Optimizations for the Monad Comprehension Calculus
نویسنده
چکیده
The Monad Comprehension Calculus (MCC) is a highly expressive query language equal in expressive power to a subset of the Haskell programming language. This expressivity allows the MCC to subsume a variety of user-facing query languages, from nested relational algebra to OQL. The MCC possess a number of highlydesirable properties, including a normal form for queries that eliminates query nesting in a complete way and a uniform and abstract treatment of collection types. Within the last decade sophisticated SQL/OQL optimization techniques based on semantic optimization have been applied to the MCC’s SQL/OQL fragment. In this paper we begin to apply relational optimizations to the entirety of the MCC. We do not approach the level of sophistication possible in the SQL/OQL fragment, and our optimizations are simple rewrites based on intra-relation functional dependencies. Still, by exploiting the so-called algebra of programming, the fledgling point-free functional dependency theory, and a translation from a subset of the MCC to nested relational algebra, we are able to reason about relational optimizations in the broader context of the MCC in an equational, compositional, and easily mechanizable way. We demonstrate how to optimize functional programs by exploiting knowledge about their functional dependencies, and how to optimize relational queries translated into MCC based on the underlying, rich algebraic structure of the MCC.
منابع مشابه
Collection Processing with Constraints, Monads, and Folds
We propose an intermediate form based on monad-algebra comprehensions (to represent queries), folds (to represent computation), and setoids over polynomial datatypes (to represent data), suitable for use in collection processing. Such an intermediate form captures, in a uniform way, large fragments of many recent largescale collection processing languages such as MapReduce, PIG, DryadLINQ, and ...
متن کاملA Conserative Property of a Nested Relational Query Language
We proposed in [7] a nested relational calculus and a nested relational algebra based on structural recursion [6,5] and on monads [27,16]. In this report, we describe relative set abstraction as our third nested relational query language. This query language is similar to the well known list comprehension mechanism in functional programming languages such as Haskell [ll], Miranda [24], KRC [23]...
متن کامل1. Monad Comprehensions: A Versatile Representation for Queries
This chapter is an exploration of the possibilities that open up if we consistently adopt a style of database query and collection processing which allows us to look inside collections and thus enables us to play with atomic constructors instead of the monolithic collection values they build. This comprehension of values goes well together with a completely functional style of query formulation...
متن کاملPathfinder: XQuery Off the Relational Shelf
The Pathfinder project makes inventive use of relational database technology—originally developed to process data of strictly tabular shape—to construct efficient database-supported XML and XQuery processors. Pathfinder targets database engines that implement a set-oriented mode of query execution: many off-the-shelf traditional database systems make for suitable XQuery runtime environments, bu...
متن کاملComprehending queries
There are no compelling reasons why database-internal query representations have to be designated by operators. This text describes a world in which datatypes determine the comprehension of queries. In this world, a datatype is characterized by its algebra of value constructors. These algebras are principal. Query operators are secondary in the sense that they simply box (recursive) programs th...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2009